
do "E:/ReplicateBuild/02_code/00_environment/00_set_environment.do"

********************************************************************************
* Build FOCAL data
********************************************************************************

* applications
do "$code/01_build/01_build_FOCAL_applications.do"

* applicant characteristics
do "$code/01_build/02_build_FOCAL_applicants.do"

* teacher characteristics
do "$code/01_build/03_build_FOCAL_teachers.do"


********************************************************************************
* Build NCERDC data
********************************************************************************

* experience, school, district, salary, ethnicity, gender, teacher test scores, BA date, MA date, BA inst, MA inst
do "$code/01_build/04_build_ncerdc_teach_charac.do"


* student-teacher classroom match
do "$code/01_build/05_build_ncerdc_student_teacher_match.do"

* suspension data

do "$code/01_build/05b_build_suspensions.do"

* estimate VA
* base model
do "$code/01_build/06_build_VA_w_drift_keep_missings.do"
* homogenous VA
do "$code/01_build/06a_build_homogeneous_VA_w_drift.do"
* CFR
do "$code/01_build/06b_build_homogeneous_VA_w_drift_cfr_w_classmeans.do"
* bootstrap base model
do "$code/01_build/06c_estimate_VA_bootstrap.do"
* with school mean characteristics rather than school FEs
do "$code/01_build/06d_build_VA_w_drift_schoolMeans.do"
* behavioral VA
do "$code/01_build/06e_build_VA_w_drift_behavioral.do"


* common core data, report card data
do "$code/01_build/07_build_ncerdc_school_charac.do"

********************************************************************************
* Build HRMS data
********************************************************************************

* crosswalk, applications, applicants, and vacancies
do "$code/01_build/08_build_hrms_applications.do"


********************************************************************************
* Build analysis data
********************************************************************************

* merge for base datasets for FOCAL applicants
do "$code/01_build/09_merge_FOCAL_ncerdc_data.do"

* construct commute times
do "$code/01_build/10_prepare_data_for_commute.do"

* construct analysis data -- choice sets, etc.
do "$code/01_build/11_construct_choice_sets.do"

* impute teacher VA
* Note: creates Appendix Tables A32, A33, A34, A35
do "$code/01_build/12_impute_VA.do"

* export teacher preference data for estimation
do "$code/01_build/13_teacher_pref_estimation_data_include_current.do"

* export principal rating data for estimation
do "$code/01_build/14_principal_pref_estimation_data.do"
